package JBANK;

public class Bank {

	private double creditInterestRate = 0.0;
	private String closeTime = "-see description";
	private double investmentInterestRate = 0.0;
	private static int lastCustID = 0;
	private static int nextCustID = 0;
	private static String phone = "555-555-5555";
	private double premiumInterestRate = 0.0;
	private String startTime = "-see description";
	public static String website = "WWW.JBANK.COM";
	public final static String BANK_ADDRESS = "1234 JavaStreet, AnyCity, ThisState, 34567";
	public final static int MAX_NUMBER_OF_CUSTOMER = 10;
	public final static String BANK_NAME = "JBANK";
	private static int numOfCurrentCustomer = 0;
	
	private Bank(){
	}	
	
	/**
	 * Method is not needed
	 * @return BANK_ADDRESS
	 */
	
	public String getAddress(){
		
		return BANK_ADDRESS;	
	}
	
	public double getCreditRate(){
		
		return creditInterestRate;
	}
	
	public double getInvestmentRage(){
		
		return investmentInterestRate;
	}
	
	public String getHoursOfOperations(){
		
		return startTime +" "+closeTime;
	}
	
	public static int getLastID(){
		
		return lastCustID;
	}
	
	/**
	 * Method is not needed
	 * @return MAX_NUMBER_OF_CUSTOMER
	 */
	public int getMaxCustomer(){
		
		return MAX_NUMBER_OF_CUSTOMER;
	}
	
	/**
	 * Method is not needed
	 * @return BANK_NAME
	 */
	public String getName(){
		
		return BANK_NAME;
	}
	
	public static int getNextID(){
		
		int return_value = 0;
		
		if(nextCustID == 0){
			
			nextCustID = 1000;
			lastCustID = nextCustID;
			++numOfCurrentCustomer;
			return_value = nextCustID;
			
		} else if (numOfCurrentCustomer == MAX_NUMBER_OF_CUSTOMER ){
			
			System.out.println("You can not created more Customer");
			lastCustID = nextCustID;
			
			}else {
				
				lastCustID = nextCustID++;
				++numOfCurrentCustomer;
				
				return_value = nextCustID;
				
			}		
		
		return return_value;
	}
	
	public String getWebsite(){
		
		return website;
	}
	
	public double getPremiumRate(){
		
		return premiumInterestRate;
	}
	
	public String getPhone(){
		
		return phone;
	}
	
	public void setCreditRate(double rate){
		
		creditInterestRate = rate;
	}
	
	public void setInvestmentRate(double rate){
		
		investmentInterestRate = rate;
	}
	
	public void setPremiumRate(double rate){
		
		premiumInterestRate = rate;
	}
	
	public static int getNumOfCurrentCustomer(){
		
		return numOfCurrentCustomer;
	}
	
}
